package Collection;

import java.util.LinkedList;

/**
 * @author wuhan
 * @date 2019/9/25 18:55
 */

class DuiLie{
    private LinkedList link;
    DuiLie(){
        link=new LinkedList();
    }
    public void myAdd(Object obj){
        link.addFirst(obj);
    }
    public Object myGet(){
        return link.peekFirst();
    }
    public boolean isNull(){
        return link.isEmpty();
    }


}




public class LinkedListDemo {

    public static void main(String[] args) {
        DuiLie duiLie=new DuiLie();
        duiLie.myAdd("asfasf");
        duiLie.myAdd("dasfa");
        System.out.println(duiLie.myGet());
        System.out.println(duiLie.myGet());

    }
}
